<?php

set_include_path( "./lib/ezC;" . ini_get( "include_path" )  );
require_once "Base/src/base.php";
function __autoload( $className )
{
	ezcBase::autoload( $className );
}

include_once( 'kernel/classes/lazyconfiguration/customlazytemplateconfiguration.php' );
include_once( 'kernel/classes/lazyconfiguration/customlazyconfigurationconfiguration.php' );

$oConfigurationManager = ezcConfigurationManager::getInstance();

// register an url under the alias 'website_root'
ezcUrlCreator::registerUrl(
	'website_root',
	$oConfigurationManager->getSetting( 'site', 'SiteSettings', 'SiteURL' ).'%s'
);
//var_dump( ezcUrlCreator::getUrl( 'website_root', 'map_norway.gif' ) );

// Use the default configuration.
$oTemplate = new ezcTemplate();
$oTemplate->send->sSiteTitle = $oConfigurationManager->getSetting( 'site', 'SiteSettings', 'SiteTitle' );
$oTemplate->send->sCharset   = $oConfigurationManager->getSetting( 'site', 'CharactersEncoding', 'Charset' );

// Compiles the template and returns the result.
// It searches for the hello_world template in the current directory.
echo $oTemplate->process( "pagelayout.ezt" );

// Classes loaded and configured on first request

?>